<?php

namespace Modules\Common\Models\Validation;


/**
 *@property int $id
 *@property int $from_id
 *@property int $from_type
 *@property int $to_id
 *@property int $to_type
 *@property string $title
 *@property string $content
 *@property int $has_read
 *@property int $is_broadcast
 *@property string $created_at
 *@property string $updated_at
 *@property string $deleted_at
 */
trait SiteMessageValidation 
{


    public function createRules()
    {
         return [
            'rules' => [
                'from_id'=>'integer',
                'from_type'=>'integer|in:0,1,2',
                'to_id'=>'integer',
                'to_type'=>'integer|in:0,1,2',
                'title'=>'between:0,255',
                'content'=>'between:0,255',
                'has_read'=>'integer',
                'is_broadcast'=>'integer',
                
            ],
            'messages' => [
            ],
            'customAttributes' => [
            ]
        ];
    }

    public function updateRules()
    {
         return [
            'rules' => [
                'from_id'=>'integer',
                'from_type'=>'integer|in:0,1,2',
                'to_id'=>'integer',
                'to_type'=>'integer|in:0,1,2',
                'title'=>'between:0, 255',
                'content'=>'between:0, 255',
                'has_read'=>'integer',
                'is_broadcast'=>'integer',
                
            ],
            'messages' => [
            ],
            'customAttributes' => [
            ]
        ];
    }


}
